﻿using DTO.BaseDTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DTO.BaseDTO
{
    public class RealAddressDTO
    {
        private AddressDTO _address;
        private DistrictDTO _district;
        private WardDTO _ward;
        private ProvinceDTO _province;

        public RealAddressDTO(String addressId, String addressNumber,
                                String wardId, String wardName,
                                String districtId, String districtName,
                                String provinceId, String provinceName)
        {
            AddressId = addressId;
            AddressNumber = addressNumber;
            WardId = wardId;
            WardName = wardName;
            DistrictId = districtId;
            DistrictName = districtName;
            ProvinceId = provinceId;
            ProvinceName = provinceName;
        }

        public String AddressId
        {
            get { return _address.Id; }
            set { _address.Id = value; }
        }

        public String AddressNumber
        {
            get { return _address.AddressNumber; }
            set { _address.AddressNumber = value; }
        }

        public String DistrictId
        {
            get { return _district.Id; }
            set { _district.Id = value; }
        }

        public String DistrictName
        {
            get { return _district.DistrictName; }
            set { _district.DistrictName = value; }
        }
        public String WardId
        {
            get { return _ward.Id; }
            set { _ward.Id = value; }
        }

        public String WardName
        {
            get { return _ward.WardName; }
            set { _ward.WardName = value; }
        }

        public String ProvinceId
        {
            get { return _province.Id; }
            set { _province.Id = value; }
        }

        public String ProvinceName
        {
            get { return _province.ProvinceName; }
            set { _province.ProvinceName = value; }
        }

        public String ToString()
        {
            return _district.ToString() + 
                "-" + _ward.ToString() + 
                "-" + _district.ToString() + 
                "-" + _province.ToString(); 
        }
    }

    public class AddressDTO : ObjectDTO
    {
        protected String _addressNumber;
        protected String _wardId;

        public String AddressNumber
        {
            get { return _addressNumber; }
            set { _addressNumber = value; }
        }

        public String WardId
        {
            get { return _wardId; }
            set { _wardId = value; }
        }

        public String ToString()
        {
            return _addressNumber;
        }
    }

    public class WardDTO : ObjectDTO
    {
        private String _wardName;
        private String _districtId;

        public String DistrictId
        {
            get { return _districtId; }
            set { _districtId = value; }
        }

        public String WardName
        {
            get { return _wardName; }
            set { _wardName = value; }
        }

        public String ToString()
        {
            return WardName;
        }
    }

    public class DistrictDTO : ObjectDTO
    {
        private String _districtName;
        private String _provinceId;

        public String ProvinceId
        {
            get { return _provinceId; }
            set { _provinceId = value; }
        }

        public String DistrictName
        {
            get { return _districtName; }
            set { _districtName = value; }
        }

        public String ToString()
        {
            return DistrictName;
        }
    }

    public class ProvinceDTO : ObjectDTO
    {
        private String _provinceName;

        public String ProvinceName
        {
            get { return _provinceName; }
            set { _provinceName = value; }
        }

        public String ToString()
        {
            return ProvinceName;
        }
    }
}
